package com.woniuxy.mapper;

import com.woniuxy.entity.Activity;
import com.woniuxy.entity.ActivityExample;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/*
@author Jan
@create 2020-05-20 19:00

*/

public interface ActivityMapper {
    long countByExample(ActivityExample example);

    int deleteByExample(ActivityExample example);

    int deleteByPrimaryKey(Integer actId);

    int insert(Activity record);

    int insertSelective(Activity record);

    List<Activity> selectByExample(ActivityExample example);

    Activity selectByPrimaryKey(Integer actId);

    int updateByExampleSelective(@Param("record") Activity record, @Param("example") ActivityExample example);

    int updateByExample(@Param("record") Activity record, @Param("example") ActivityExample example);

    int updateByPrimaryKeySelective(Activity record);

    int updateByPrimaryKey(Activity record);

    ArrayList<Map<String, Object>> selectActivtyList(String city);

    List<Map<String, Object>> selectActivityById(Integer actId);

    @Select("select count(1) from activity_order o where status = #{status} and user_id = #{userId}")
    long selectCountByStatusAndUserId(Integer status, Integer userId);
}